﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JrpcTest
{
	internal class JsonRpcReqRspInfo
	{
		public DateTime ReqestBegin { get; set; }
		public DateTime ReqestEnd { get; set; }

		public string? FuncName { get; set; }
		public JObject? Request { get; set; }
		public JObject? Response { get; set; }
	}

	internal class JsonRpcFunctionInfo : INotifyPropertyChanged
	{
		public JsonRpcFunctionInfo(string funcName)
		{
			FuncName = funcName;
		}

		public string FuncName { get; }

		public event PropertyChangedEventHandler? PropertyChanged;
		
		private void NotifyPropertyChanged(string propertyName)
			=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));

		JsonRpcReqRspInfo? _reqrsp;
		public JsonRpcReqRspInfo? ReqRspInfo
		{
			get { return _reqrsp; }
			set
			{
				_reqrsp = value;
				NotifyPropertyChanged(nameof(ReqRspInfo));
			}
		}
	}
}
